package com.mall.hadoop.job.abilityrds;

import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.log4j.Logger;

/**
 * 八大能力更新到rds
 * @author tgy
 *
 */
public class AbilityRdsMap extends Mapper<LongWritable, Text, Text, IntWritable>{

	Logger logger = Logger.getLogger(AbilityRdsMap.class);
	
	@Override
	protected void map(LongWritable key, Text value,Context context)throws IOException, InterruptedException {
		try{
			String[] str = value.toString().split(",");
			context.write(new Text(str[0]), new IntWritable(Integer.parseInt(str[1])));
		}catch(Exception e){
			logger.info("AbilityRdsMap八大能力解析异常："+e.toString());
		}
	}
}
